A network of autonomous systems, also referred to herein as a Border Gate Protocol (BGP) network, uses “hot potato” routing to direct traffic from a given router in the network to closest egress points within the BGP network. The BGP network includes concentrator routers called route reflectors that are peered with BGP client routers of the route reflector. A route reflector uses a BGP best path algorithm to select an egress point closest to the route reflector. The egress point is a BGP best path from a perspective of the route reflector, but is not necessarily a best path for each of the client routers. BGP Optimal Route Reflection (ORR) allows route reflectors to operate from a cloud environment without compromising hot potato routing. In BGP ORR, the route reflectors use the BGP best path algorithm to select customized best paths for the route reflector and its ORR client routers.
Conventional BGP ORR requires the router reflector to execute a conventional BGP best path algorithm multiple times, once for the router reflector and then once per ORR client router. This is computationally wasteful in situations where the route reflector and the ORR client routers all share the same best path. In addition, the conventional BGP best path algorithm uses a fixed set of ordered comparison tests, even when some of the tests are unnecessary, which is also computationally wasteful.